package mystia.lorelei.app.service;

import jakarta.annotation.Resource;
import mystia.lorelei.app.entity.Cuisine;
import mystia.lorelei.app.entity.Member;
import mystia.lorelei.app.repository.MemberRepository;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MemberService {
	@Resource
	private MemberRepository memberRepository;
	public List<Member> listMembers() {
		return memberRepository.findAll();
	}
	public Member queryMemberById(int id){return memberRepository.findById(id).orElse(null);}
	public void saveMember(Member member) {
		memberRepository.save(member);
	}
	
	public void deleteMember(int id){
		memberRepository.deleteById(id);
	}
	public void deleteMembers(List<Integer> ids){memberRepository.deleteAllByIds(ids);}
}
